package org.github.manx98.jlibhac.tools.fssystem.ncautils;

import lombok.ToString;
import org.github.manx98.jlibhac.common.math.Uint64;
import org.github.manx98.jlibhac.common.reflect.StructureMap;
import org.github.manx98.jlibhac.fssystem.NcaEncryptionType;
import org.github.manx98.jlibhac.fssystem.NcaFormatType;
import org.github.manx98.jlibhac.fssystem.NcaHashType;

/**
 * @author Manx98
 * @version 1.0
 * @since 2022/10/3 17:01
 */
@ToString
public class FsHeaderStruct {
    public static final int IntegrityInfoOffset = 8;
    public static final int IntegrityInfoSize = 0xF8;
    public static final int PatchInfoOffset = 0x100;
    public static final int PatchInfoSize = 0x40;
    public static final int SparseInfoOffset = 0x148;
    public static final int SparseInfoSize = 0x30;
    public static final int CompressionInfoOffset = 0x178;
    public static final int CompressionInfoSize = 0x20;

    @StructureMap(offset = 0)
    public short Version;
    @StructureMap(offset = 2)
    public NcaFormatType FormatType;
    @StructureMap(offset = 3)
    public NcaHashType HashType;
    @StructureMap(offset = 4)
    public NcaEncryptionType EncryptionType;
    @StructureMap(offset = 0x140)
    public Uint64 UpperCounter;
    @StructureMap(offset = 0x140)
    public int CounterType;
    @StructureMap(offset = 0x144)
    public int CounterVersion;
}
